\doxysection{ins\+\_\+task.\+h}
\hypertarget{ins__task_8h_source}{}\label{ins__task_8h_source}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/imu/ins\_task.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/imu/ins\_task.h}}
\mbox{\hyperlink{ins__task_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00015\ \textcolor{preprocessor}{\#ifndef\ \_\_INS\_TASK\_H}}
\DoxyCodeLine{00016\ \textcolor{preprocessor}{\#define\ \_\_INS\_TASK\_H}}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \textcolor{preprocessor}{\#include\ "{}stdint.h"{}}}
\DoxyCodeLine{00019\ \textcolor{preprocessor}{\#include\ "{}BMI088driver.h"{}}}
\DoxyCodeLine{00020\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{_quaternion_e_k_f_8h}{QuaternionEKF.h}}"{}}}
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00022\ \textcolor{preprocessor}{\#define\ X\ 0}}
\DoxyCodeLine{00023\ \textcolor{preprocessor}{\#define\ Y\ 1}}
\DoxyCodeLine{00024\ \textcolor{preprocessor}{\#define\ Z\ 2}}
\DoxyCodeLine{00025\ }
\DoxyCodeLine{00026\ \textcolor{preprocessor}{\#define\ INS\_TASK\_PERIOD\ 1}}
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00028\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
\DoxyCodeLine{00029\ \{}
\DoxyCodeLine{00030\ \ \ \ \ \textcolor{keywordtype}{float}\ Gyro[3];\ \ \textcolor{comment}{//\ 角速度}}
\DoxyCodeLine{00031\ \ \ \ \ \textcolor{keywordtype}{float}\ Accel[3];\ \textcolor{comment}{//\ 加速度}}
\DoxyCodeLine{00032\ \ \ \ \ \textcolor{comment}{//\ 还需要增加角速度数据}}
\DoxyCodeLine{00033\ \ \ \ \ \textcolor{keywordtype}{float}\ Roll;}
\DoxyCodeLine{00034\ \ \ \ \ \textcolor{keywordtype}{float}\ Pitch;}
\DoxyCodeLine{00035\ \ \ \ \ \textcolor{keywordtype}{float}\ Yaw;}
\DoxyCodeLine{00036\ \ \ \ \ \textcolor{keywordtype}{float}\ YawTotalAngle;}
\DoxyCodeLine{00037\ \}\ \mbox{\hyperlink{structattitude__t}{attitude\_t}};\ \textcolor{comment}{//\ 最终解算得到的角度,以及yaw转动的总角度(方便多圈控制)}}
\DoxyCodeLine{00038\ }
\DoxyCodeLine{00039\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
\DoxyCodeLine{00040\ \{}
\DoxyCodeLine{00041\ \ \ \ \ \textcolor{keywordtype}{float}\ q[4];\ \textcolor{comment}{//\ 四元数估计值}}
\DoxyCodeLine{00042\ }
\DoxyCodeLine{00043\ \ \ \ \ \textcolor{keywordtype}{float}\ MotionAccel\_b[3];\ \textcolor{comment}{//\ 机体坐标加速度}}
\DoxyCodeLine{00044\ \ \ \ \ \textcolor{keywordtype}{float}\ MotionAccel\_n[3];\ \textcolor{comment}{//\ 绝对系加速度}}
\DoxyCodeLine{00045\ }
\DoxyCodeLine{00046\ \ \ \ \ \textcolor{keywordtype}{float}\ AccelLPF;\ \textcolor{comment}{//\ 加速度低通滤波系数}}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00048\ \ \ \ \ \textcolor{comment}{//\ bodyframe在绝对系的向量表示}}
\DoxyCodeLine{00049\ \ \ \ \ \textcolor{keywordtype}{float}\ xn[3];}
\DoxyCodeLine{00050\ \ \ \ \ \textcolor{keywordtype}{float}\ yn[3];}
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keywordtype}{float}\ zn[3];}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ \ \ \ \ \textcolor{comment}{//\ 加速度在机体系和XY两轴的夹角}}
\DoxyCodeLine{00054\ \ \ \ \ \textcolor{comment}{//\ float\ atanxz;}}
\DoxyCodeLine{00055\ \ \ \ \ \textcolor{comment}{//\ float\ atanyz;}}
\DoxyCodeLine{00056\ }
\DoxyCodeLine{00057\ \ \ \ \ \textcolor{comment}{//\ IMU量测值}}
\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keywordtype}{float}\ Gyro[3];\ \ \textcolor{comment}{//\ 角速度}}
\DoxyCodeLine{00059\ \ \ \ \ \textcolor{keywordtype}{float}\ Accel[3];\ \textcolor{comment}{//\ 加速度}}
\DoxyCodeLine{00060\ \ \ \ \ \textcolor{comment}{//\ 位姿}}
\DoxyCodeLine{00061\ \ \ \ \ \textcolor{keywordtype}{float}\ Roll;}
\DoxyCodeLine{00062\ \ \ \ \ \textcolor{keywordtype}{float}\ Pitch;}
\DoxyCodeLine{00063\ \ \ \ \ \textcolor{keywordtype}{float}\ Yaw;}
\DoxyCodeLine{00064\ \ \ \ \ \textcolor{keywordtype}{float}\ YawTotalAngle;}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00066\ \ \ \ \ uint8\_t\ init;}
\DoxyCodeLine{00067\ \}\ \mbox{\hyperlink{struct_i_n_s__t}{INS\_t}};}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00069\ \textcolor{comment}{/*\ 用于修正安装误差的参数\ */}}
\DoxyCodeLine{00070\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
\DoxyCodeLine{00071\ \{}
\DoxyCodeLine{00072\ \ \ \ \ uint8\_t\ flag;}
\DoxyCodeLine{00073\ }
\DoxyCodeLine{00074\ \ \ \ \ \textcolor{keywordtype}{float}\ scale[3];}
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00076\ \ \ \ \ \textcolor{keywordtype}{float}\ Yaw;}
\DoxyCodeLine{00077\ \ \ \ \ \textcolor{keywordtype}{float}\ Pitch;}
\DoxyCodeLine{00078\ \ \ \ \ \textcolor{keywordtype}{float}\ Roll;}
\DoxyCodeLine{00079\ \}\ \mbox{\hyperlink{struct_i_m_u___param__t}{IMU\_Param\_t}};}
\DoxyCodeLine{00080\ }
\DoxyCodeLine{00085\ \mbox{\hyperlink{structattitude__t}{attitude\_t}}\ *\mbox{\hyperlink{ins__task_8h_a5474fb69eaecdc5d0837dbf9790eb72c}{INS\_Init}}(\textcolor{keywordtype}{void});}
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00092\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{ins__task_8h_a79b7240e8c7e0d5419282ca230c7a85e}{INS\_Task}}(\textcolor{keywordtype}{void});}
\DoxyCodeLine{00093\ }
\DoxyCodeLine{00103\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{ins__task_8h_af69cef46084fc1f1f7f41a5e48f5a7e9}{QuaternionUpdate}}(\textcolor{keywordtype}{float}\ *q,\ \textcolor{keywordtype}{float}\ gx,\ \textcolor{keywordtype}{float}\ gy,\ \textcolor{keywordtype}{float}\ gz,\ \textcolor{keywordtype}{float}\ dt);}
\DoxyCodeLine{00104\ }
\DoxyCodeLine{00113\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{ins__task_8h_a12a2c8b057bc73a18dc7765de080bd27}{QuaternionToEularAngle}}(\textcolor{keywordtype}{float}\ *q,\ \textcolor{keywordtype}{float}\ *Yaw,\ \textcolor{keywordtype}{float}\ *Pitch,\ \textcolor{keywordtype}{float}\ *Roll);}
\DoxyCodeLine{00114\ }
\DoxyCodeLine{00123\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{ins__task_8h_ab9879d429b498cb40bfb7027a771d12b}{EularAngleToQuaternion}}(\textcolor{keywordtype}{float}\ Yaw,\ \textcolor{keywordtype}{float}\ Pitch,\ \textcolor{keywordtype}{float}\ Roll,\ \textcolor{keywordtype}{float}\ *q);}
\DoxyCodeLine{00124\ }
\DoxyCodeLine{00132\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{ins__task_8h_a151377c6cfa1152d7642d42cd7dd5d3d}{BodyFrameToEarthFrame}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{float}\ *vecBF,\ \textcolor{keywordtype}{float}\ *vecEF,\ \textcolor{keywordtype}{float}\ *q);}
\DoxyCodeLine{00133\ }
\DoxyCodeLine{00141\ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{ins__task_8h_add6f841604e6b40025533d6e58d74ac8}{EarthFrameToBodyFrame}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{float}\ *vecEF,\ \textcolor{keywordtype}{float}\ *vecBF,\ \textcolor{keywordtype}{float}\ *q);}
\DoxyCodeLine{00142\ }
\DoxyCodeLine{00143\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
